package priv.mill.base;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Properties;

import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.log4j.Logger;

import priv.mill.entry.Memp;

public class EmpFactory extends DefaultObjectFactory{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final Logger logger = Logger.getLogger(EmpFactory.class);
	private Class type;
	public Object create(Class type) {
		logger.debug(type.getName());
		this.type=type;
		if(type.getName().equals("priv.mill.entry.Memp")){
			
			Memp memp = new Memp();
			memp.setComm(new BigDecimal(34));
			return memp;
		}
	    return super.create(type);
	}
	
	
	@Override
	public <T> T create(Class<T> type, List<Class<?>> constructorArgTypes,
			List<Object> constructorArgs) {
		return super.create(type, constructorArgTypes, constructorArgs);
	}

	
	  public void setProperties(Properties properties) {
	    super.setProperties(properties);
	  }
	  public <T> boolean isCollection(Class<T> type) {
	    return Collection.class.isAssignableFrom(type);
	  }
}
